function [Z,testlabel,indices,count] = randomSelectLabeledData(gnd,per)

[indices,count]=SelLabSam_Semi_2(gnd,per);
subN = size(gnd,1);
ind=[1:1:subN];
ind(indices)=[];
testlabel=gnd(ind);

Z = zeros(subN,subN);
for i = 1:count
    a = indices(i);    %%% location of labeled data point
    for j = i+1:count
        b = indices(j);
        if gnd(a)==gnd(b)
           Z(a,b)=1;
        else
           Z(a,b)=-1; 
        end
    end
end
Z = (Z+Z');
Z = Z + eye(subN);


end

